package org.zn.mvcbase.mybatis.ddl;


import java.util.ArrayList;
import java.util.List;

public class TableEntity {
	
	private String schema;
	private String tableName;
	private List<Column> columns;
	private List<String> ids=new ArrayList<>();

	public String getSchema() {
		return schema;
	}

	public void setSchema(String schema) {
		this.schema = schema;
	}

	public String getTableName() {
		return tableName;
	}

	public void setTableName(String tableName) {
		this.tableName = tableName;
	}

	public List<Column> getColumns() {
		return columns;
	}


	public void setColumns(List<Column> columns) {
		this.columns = columns;
	}
	
	public void addId(String id) {
		ids.add(id);
	}
	
	public List<String> getIds() {
		return ids;
	}


	public static class Column{
		
		private String name;
		
		private String chamge_name;
		
		private String type;
		private String length;
		private Boolean notnull=null;  //false:NULL true:not null  null:none
 		private boolean pk;
		private boolean fk;
		private String coment;
		private String defaultValue;
		
		private String unsigned; 
		private String autoIncrement;
		public String getName() {
			return name;
		}
		public void setName(String name) {
			this.name = name;
		}
		public String getType() {
			return type;
		}
		public void setType(String type) {
			this.type = type;
		}
		public String getLength() {
			return length;
		}
		public void setLength(String length) {
			this.length = length;
		}
		public Boolean getNotnull() {
			return notnull;
		}
		public void setNotnull(Boolean notnull) {
			this.notnull = notnull;
		}
		public boolean isPk() {
			return pk;
		}
		public void setPk(boolean pk) {
			this.pk = pk;
		}
		public String getComent() {
			return coment;
		}
		public void setComent(String coment) {
			this.coment = coment;
		}
		public String getDefaultValue() {
			return defaultValue;
		}
		public void setDefaultValue(String defaultValue) {
			this.defaultValue = defaultValue;
		}
		public String getUnsigned() {
			return unsigned;
		}
		public void setUnsigned(String unsigned) {
			this.unsigned = unsigned;
		}
		public String getAutoIncrement() {
			return autoIncrement;
		}
		public void setAutoIncrement(String autoIncrement) {
			this.autoIncrement = autoIncrement;
		}
		public boolean isFk() {
			return fk;
		}
		public void setFk(boolean fk) {
			this.fk = fk;
		}
		public String getChamge_name() {
			return chamge_name;
		}
		public void setChamge_name(String chamge_name) {
			this.chamge_name = chamge_name;
		}
		
		
		
		
	}


	@Override
	public String toString() {
		return "TableEntity [schema=" + schema + ", tableName=" + tableName + ", columns=" + columns + ", ids=" + ids
				+ "]";
	}
	
	
	

}
